<?php /*a:3:{s:41:"D:\www\long_shop\app\view\admin\news.html";i:1702389678;s:42:"D:\www\long_shop\app\view\common\head.html";i:1702389678;s:48:"D:\www\long_shop\app\view\common\pagination.html";i:1702389678;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <script src="/static/jquery/jquery-1.12.4.min.js"></script>    
    <link href="/static/bst5.3.2/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/bst5.3.2/js/bootstrap.bundle.min.js"></script>
    <link rel="stylesheet" href="/static/bst-icons/font/bootstrap-icons.css">
    <script src="/static/layer/layer/layer.js"></script>
    <link rel="stylesheet" href="/static/css/my.css">    
</head>
<head>
<title>咨讯管理</title>

<style>
  .box{border: 0px solid #ccc;text-align: left;padding:10px 20px;}
</style>
</head>
<body style="">


<div class="box "  style="border:0 solid #ccc;"  >

    <h2>资讯管理</h2>
    <table class="table table-sm table-hover table-striped" >

        <thead>
            <th>编号</th>
            <th>image</th>               
            <th>标题</th>
            <th>内容</th>
            <th>时间</th>
            <th>状态</th>
            <th>
              <button type="button" class="btn btn-sm btn-primary" id="news_add">
                  <span class="bi-plus-lg" style="color:white;"></span>
              </button>
            </th>
        </thead>

        <tbody>
            <?php foreach($list['data'] as $k=>$kv): ?>
            <tr>
                <td><?php echo htmlentities($kv['id']); ?></td>
                <td><img src="<?php echo htmlentities($kv['image']); ?>"  style="width:100px;" /></td>                
                <td style="
                    <?php if($kv['status']>1): ?> color:red; <?php endif; if($kv['status']>2): ?> text-decoration:line-through; <?php endif; ?>
                "><?php echo htmlentities($kv['title']); ?></td>
                <td style="max-width:300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><?php echo htmlentities($kv['content2']); ?></td>
                <td><?php echo htmlentities($kv['create_time']); ?></td>
                <td><?php echo htmlentities($kv['status']); ?></td>
                <td>
                    <button style="button" class="btn btn-sm btn-info news_edit" news_id="<?php echo htmlentities($kv['id']); ?>" ><span class="bi-pencil"></span></button>
                </td>
            </tr>
            <?php endforeach; ?>

        </tbody>    
    </table>

          <ul class="pagination pagination" >

        <?php if($list['current_page']>1): ?>
            <li class="page-item">
                <a class="page-link" href="?page=1<?php if(!empty($query)): ?><?php echo htmlentities($query); ?><?php endif; if(!empty($show_grid)): ?>&show_grid=<?php echo htmlentities($show_grid); ?><?php endif; ?>">
                    <span class="bi-chevron-double-left"></span>
                </a>
            </li>
            <li class="page-item">
                <a class="page-link" href="?page=<?php echo htmlentities($list['current_page']-1); if(!empty($query)): ?><?php echo htmlentities($query); ?><?php endif; if(!empty($show_grid)): ?>&show_grid=<?php echo htmlentities($show_grid); ?><?php endif; ?>">
                    <span class="bi-chevron-left"></span>
                </a>
            </li>
        <?php endif; ?>

        <li class="page-item">
            <c class="page-link text-secondary"><?php echo htmlentities($list['current_page']); ?>/<?php echo htmlentities($list['last_page']); ?></c>
        </li>

        <?php if($list['current_page']<$list['last_page']): ?>
            <li class="page-item">
                <a class="page-link" href="?page=<?php echo htmlentities($list['current_page']+1); if(!empty($query) && $query!=''): ?><?php echo htmlentities($query); ?><?php endif; if(!empty($show_grid)): ?>&show_grid=<?php echo htmlentities($show_grid); ?><?php endif; ?>">
                    <span class="bi-chevron-right"></span>    <!--下一页-->
                </a>
            </li>
            <li class="page-item">
                <a class="page-link" href="?page=<?php echo htmlentities($list['last_page']); if(!empty($query)): ?><?php echo htmlentities($query); ?><?php endif; if(!empty($show_grid)): ?>&show_grid=<?php echo htmlentities($show_grid); ?><?php endif; ?>">
                    <span class="bi-chevron-double-right"></span>    <!--末页-->
                </a>
            </li>
        <?php endif; ?>


      </ul>
      <br/>
      
  </div>

<script type="text/javascript">

    $(function(){
      $("#news_add").on('click',function(){
        location.href="/index/news_edit";
      })      


      $(".news_edit").on('click',function(){
        var id = $(this).attr('news_id');
        var url ="/index/news_edit/id/"+id;
        console.log(url);
        location.href=url;
      })
    })

</script>


</body>
</html>
